export default {
	namespaced: true,
	
	state: {
		themeColor:'#888888',
		bannerDotColor:"#888888",
		bannerDotActiveColor:"#888888",
		tabbar:[
			{page:"index",title:"首页",iconPath:"https://manager.ryz1620.com/static/common/home.png",selectedIconPath:"https://manager.ryz1620.com/static/common/home-click.png"},
			{page:"message",title:"评论",iconPath:"https://manager.ryz1620.com/static/common/message.png",selectedIconPath:"https://manager.ryz1620.com/static/common/message-click.png"},
			// {page:"publish",iconPath:"https://manager.ryz1620.com/common/footer_add.png",selectedIconPath:"https://manager.ryz1620.comon/footer_add.png"},
			{page:"financial",title:"财务",iconPath:"https://manager.ryz1620.com/static/common/financial.png",selectedIconPath:"https://manager.ryz1620.com/static/common/financial-click.png"},
			{page:"set",title:"设置",iconPath:"https://manager.ryz1620.com/static/common/set.png",selectedIconPath:"https://manager.ryz1620.com/static/common/set-click.png"},
		],
		tabbarTextColor:'#323334',
		tabbarTextActiveColor:"#323334",
		textColor:"",
		descTextColor:"",
		priceColor:"",
		articles:[],
		showLoading:false,
		isNew:false,
		token:""
	},
	mutations: {
		SET_COLOR(state,colors){
			// 主题色
			state.themeColor = colors.themeColor
			// 轮播小点 未选中
			state.bannerDotColor = colors.bannerDotColor
			// 轮播小点 选中
			state.bannerDotActiveColor = colors.bannerDotActiveColor
			// 文字主色
			state.textColor = colors.textColor
			// 价格色
			state.priceColor = colors.priceColor
			// 描述色
			state.descTextColor = colors.descTextColor
			// 底部菜单文字 选中
			state.tabbarTextActiveColor = colors.tabbarTextActiveColor
			// 底部菜单文字 未选中
			state.tabbarTextColor = colors.tabbarTextColor
		},
	 
		
		SET_ARTICLES(state,list){
			console.log('SET_ARTICLES',list)
			state.articles = list;
		},
		
		SET_TABBAR(state,tabbar){
			state.tabbar = tabbar||[]
		},
		
		showLoading(state,sec){
			if(sec){
				state.showLoading = true;
				setTimeout(()=>{
					state.showLoading = false;
				},sec*1000)
			}else{
				state.showLoading = true;
			}
			
		},
		hideLoading(state){
			state.showLoading = false;
		}
	}
}